package com.tofacebook.model;

public class Emp {

    private Long empId;
    public String empName;
    public Integer age;
    private String sex;

    public Emp() {
        System.out.println("ioc容器实例对象是调用的无参构造方法1");
    }

    public Emp(Long empId, String empName, Integer age, String sex) {
        this.empId = empId;
        this.empName = empName;
        this.age = age;
        this.sex = sex;
    }
    public Emp(String empName) {
        this.empName = empName;
    }
    private Emp(Long empId) {
        this.empId = empId;
    }
    public Long getEmpId() {
        return empId;
    }

    public void setEmpId(Long empId) {
        this.empId = empId;
    }

    public String getEmpName() {
        return empName;
    }

    public void setEmpName(String empName) {
        this.empName = empName;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    @Override
    public String toString() {
        return "Emp{" +
                "empId=" + empId +
                ", empName='" + empName + '\'' +
                ", age=" + age +
                ", sex='" + sex + '\'' +
                '}';
    }
    //声明一个私有的构造方法
    private Emp(Long empId, String empName) {
        this.empId = empId;
        this.empName = empName;
    }
    //声明一个私有的自定义方法
    private void getEmp(){
        System.out.println("1+1="+2);
    }
    // 共有方法
    public void queryEmp(String empName){
        System.out.println("我查询到了数据，哈哈"+empName);
    }
}
